<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('index');
});
//验证码
Route::post('/sendsms', 'Auth\LoginController@sendsms');
//微信支付回调
Route::post('/notify_url', 'NotifyController@notify_url');
Route::any('/alipay/notify_url', 'NotifyController@alipay_notify_url');

Route::get('/cart', 'CartController@index');
Route::get('/page', 'PageController@index');
Route::get('/news', 'NewsController@index');
Route::get('/newsDetail/{id}', 'NewsController@detail')->where(['id' => '[0-9]+']);
Auth::routes();
/**找回密码**/
Route::post('/password/checkCode', 'Auth\ForgotPasswordController@checkCode')->name('password.checkCode');
Route::post('/password/resetsPassword', 'Auth\ForgotPasswordController@resetsPassword')->name('password.resetsPassword');

Route::get('/home', 'HomeController@index')->name('home');
//需求
Route::get('/service/detail/{id}', 'ServiceController@detail');
Route::get('/service', 'ServiceController@index');
Route::get('/data', 'DataController@index');
//用户
Route::group(['middleware' => ['auth']], function () {
    Route::post('/saveUserInfo', 'Auth\UserController@saveUserInfo')->name('saveUserInfo');
    Route::get('/user/myCard', 'Auth\UserController@myCard');
	Route::get('/user/deleteCart/{id}', 'Auth\UserController@deleteCart');
    //需求
    Route::any('/user/sendService', 'Auth\UserController@sendService');
    Route::any('/user/myService', 'Auth\UserController@myService');
    Route::get('/user/deleteService/{id}', 'Auth\UserController@deleteService');
    //数据
    Route::get('/user/dataCenter', 'Auth\UserController@dataCenter');
    Route::post('/user/facebook', 'Auth\UserController@facebook');
    Route::post('/user/facebook/{id}', 'Auth\UserController@facebook')->where(['id' => '[0-9]+']);
    //名片
    Route::any('/user/sendCart', 'Auth\UserController@sendCart');
    //购买
    Route::post('/user/buy', 'Auth\UserController@buy');
    Route::get('/user/buyRecord', 'Auth\UserController@buyRecord');
    //查看名片
    Route::post('/user/showCart', 'Auth\UserController@showCart');
    //账户充值提现
    Route::any('/user/reCharge', 'Auth\UserController@reCharge');
    Route::any('/user/recharge', 'Auth\UserController@reCharge');
	
	Route::any('/user/income', 'Auth\UserController@inCome');
    Route::any('/user/withdraw', 'Auth\UserController@withdraw');
	Route::any('/user/withdrawRecord', 'Auth\UserController@withdrawRecord');
	
	Route::get('/pay', ['as' => 'website.pay', 'uses' => 'PayController@index']);
	
});
